function* helloWorldGenerator() {
    yield '吃饭';
    yield '拉屎';
    return '睡觉';
  }
  
  var hw = helloWorldGenerator();

  console.log(hw.next())
  console.log(hw.next())
  console.log(hw.next())
  console.log(hw.next())

//   状态机